<?php
/**
 * Created by PhpStorm.
 * User: user1
 * Date: 2018/9/3
 * Time: 11:29
 */

namespace app\admin\controller;


use app\common\service\JurisdictionService;

class Index extends Common
{
    
    /**
     * 后台框架主页
     * @return \think\response\View
     * @throws \think\Exception
     * @throws \think\exception\DbException
     */
    public function index() {

//        session("admin",null);
        $admin  = session('szb_admin');
//        dump($admin);exit;
        if (!$admin) {
            $this->redirect('/admin/login/index', '请先登录');
        }
        $this->assign('username', $admin['nickname']);
        // 获取当前管理员的导航数据
        $menu = JurisdictionService::getAdminShowMenu($admin);
//        dump($menu);exit;

        JurisdictionService::setMenuUrl($menu);

//        dump($menu);exit;
        $this->assign('menu', $menu);

        return view('index/index');
    }
}